package miiteen.demo.duty.dao;

import miiteen.data.dao.impl.BaseDaoImpl;

import miiteen.demo.duty.beans.Instruction;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@Repository("instructionDao")
public class InstructionDao extends BaseDaoImpl<Instruction> {
    @Override
    protected String getMapper(){
        return "miiteen.demo.duty.beans.Instruction";
    }

    @Resource(name = "sqlSessionFactory3")
    public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory){
        super.setSqlSessionFactory(sqlSessionFactory);
    }

    public List<Instruction> findByUserName(Map<String,Object> map){
        return getSqlSession().selectList(getMapper()+".findByUserName",map);
    }
    public List<Instruction> findAllList(Map<String,Object> map){
        return getSqlSession().selectList(getMapper()+".findAllList",map);
    }
    public Instruction findTotalCount(Map<String,Object> map){
        return getSqlSession().selectOne(getMapper()+".findTotalCount",map);
    }


}
